package com.bdilab.iot.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bdilab.iot.model.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * @author WangNing
 * @version 1.0
 * @date 2020/7/31 16:51
 */
@Mapper
public interface RoleMapper extends BaseMapper<Role> {

    @Select("select * from `role` where id > 0")
    List<Role> getAllRole();

    @Select("select count(1) from `role` where `name` = #{role_name}")
    int countRoleName(@Param("role_name") String roleName);

    @Select("select id from `role`")
    List<Long> getAllRoleId();

    int updateRole(Role role);


}
